class · System.Threading.Tasks
Task<T>
public class System.Threading.Tasks.Task<T> : System.Threading.Tasks.Task
A task with a value: what an async function that returns one gives.
- Kind
- class
- Namespace
- System.Threading.Tasks
- Assembly
- System.Core
- Access
- public
- Source file
Tasks.ant
Type parameters
| Name | Constraints |
|---|---|
T | any type |
Inheritance
Properties
property Result: T
#
The value, once done (runs the scheduler until then; throws the error if it failed).
Methods
method SetResult(value: T) -> void
#
Done with value.
method GetResult() -> T
#
What await gives once the task has finished: its value (or its error, thrown).
static method FromResult(value: T) -> System.Threading.Tasks.Task<T>
#
A task done with value.
Fields
field result: T
#
Inherited members (24)
Completemethod from TaskFailmethod from TaskRunmethod from TaskPausemethod from TaskAddWaitermethod from TaskAddWaiterLockedmethod from TaskFinishmethod from TaskWakemethod from TaskWaitmethod from TaskCheckmethod from TaskDelaymethod from TaskYieldmethod from TaskDonemethod from TaskWhenAllmethod from TaskRunmethod from TaskRunmethod from TaskIsCompletedproperty from TaskIsFaultedproperty from TaskCompletedTaskproperty from TaskGetTypemethod from AnyUndescribedmethod from AnyToStringmethod from AnyHashmethod from Anydestroymethod from Any
Source
Task<T> as Larva HIR, decompiled from its Larva HIR.
// A task with a value: what an async function that returns one gives.
public class System.Threading.Tasks.Task<T> : System.Threading.Tasks.Task
{
field result: T
// Done with `value`.
method SetResult(value: T) -> void
// What `await` gives once the task has finished: its value (or its error, thrown).
method GetResult() -> T
// A task done with `value`.
static method FromResult(value: T) -> System.Threading.Tasks.Task<T>
// The value, once done (runs the scheduler until then; throws the error if it failed).
property Result: T
}